package com.jzwl.site.wap.helpoverty.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.jzwl.common.constant.Constants;
import com.jzwl.system.base.dao.BaseDAO;

@Repository("HelProverDao")
public class HelProverDao {

	@Autowired
	private BaseDAO baseDAO;

	@Autowired
	private Constants constants;

	public List<Map<String, Object>> queryGameSurvey(Map<String, Object> map) {
		String sql = "SELECT cn.columId,cn.`name`,cn.NumOrder,cet.contenId,cet.createTime,cet.title,cet.content,cet.cover,cet.digest,cet.outUrl FROM "
				+ constants.getCurrentDB()
				+ "site_content_v2 cet "
				+ " LEFT JOIN site_column_v2 cn ON cet.columId=cn.columId";
		return baseDAO.queryForList(sql);
	}

	public List<Map<String, Object>> queryCarouse(Map<String, Object> map) {
		String sql = "SELECT id,url,type,link,description,sort FROM " + constants.getCurrentDB() + "site_carousel_v2";
		return baseDAO.queryForList(sql);
	}

	public List<Map<String, Object>> queryConTact(Map<String, Object> map) {
		String sql = "SELECT id,name,contype,content FROM " + constants.getCurrentDB() + "site_contact_v2";
		return baseDAO.queryForList(sql);
	}

	public List<Map<String, Object>> queryrank(Map<String, Object> map) {
		String sql = "SELECT rankid,type,rangking,scholName,teamName,produce,award FROM " + constants.getCurrentDB()
				+ "site_ranking_v2";
		return baseDAO.queryForList(sql);
	}

	public Map<String, Object> getByContenId(Map<String, Object> map) {
		String sql = "select  contenId,columId,title,digest,content,cover,outUrl,createTime from "
				+ constants.getCurrentDB() + "site_content_v2" + " where contenId = " + map.get("contenId") + "";
		return baseDAO.queryForMap(sql);
	}

	public List<Map<String, Object>> operate(Map<String, Object> map) {
		String sql = "select  id,columtype,content from " + constants.getCurrentDB() + "site_coperate_v2";
		return baseDAO.queryForList(sql);
	}
}
